package com.yupi.yuoj.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yupi.yuoj.model.dto.learninghistory.LearningHistoryQueryRequest;
import com.yupi.yuoj.model.entity.LearningHistory;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yupi.yuoj.model.vo.LearningHistoryVO;

import javax.servlet.http.HttpServletRequest;

/**
* @author admin
* @description 针对表【learning_history(学习历史表)】的数据库操作Service
* @createDate 2025-11-01 21:28:44
*/
public interface LearningHistoryService extends IService<LearningHistory> {

    /**
     * 校验学习历史
     *
     * @param learningHistory
     * @param add
     */
    void validLearningHistory(LearningHistory learningHistory, boolean add);

    /**
     * 获取查询包装类
     *
     * @param learningHistoryQueryRequest
     * @return
     */
    QueryWrapper<LearningHistory> getQueryWrapper(LearningHistoryQueryRequest learningHistoryQueryRequest);

    /**
     * 获取学习历史封装
     *
     * @param learningHistory
     * @param request
     * @return
     */
    LearningHistoryVO getLearningHistoryVO(LearningHistory learningHistory, HttpServletRequest request);

    /**
     * 分页获取学习历史封装
     *
     * @param learningHistoryPage
     * @param request
     * @return
     */
    Page<LearningHistoryVO> getLearningHistoryVOPage(Page<LearningHistory> learningHistoryPage, HttpServletRequest request);

}
